<template>
  <div class="auto-dedup-container">
    <el-card shadow="never">
      <template #header>
        <h2>自动去重</h2>
      </template>
      
      <div class="dedup-content">
        <el-table :data="duplicateData" stripe>
          <el-table-column prop="patientName" label="患者姓名" />
          <el-table-column prop="idCard" label="身份证号" />
          <el-table-column prop="similarity" label="相似度" />
          <el-table-column label="操作">
            <template #default="{ row }">
              <el-button type="primary" size="small" @click="handleMerge(row)">合并</el-button>
              <el-button type="danger" size="small" @click="handleIgnore(row)">忽略</el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </el-card>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { ElMessage } from 'element-plus'

const duplicateData = ref([
  { patientName: '张三', idCard: '320123199001010001', similarity: '95%' },
  { patientName: '李四', idCard: '320123199002020002', similarity: '88%' }
])

const handleMerge = (row: any) => {
  ElMessage.success(`合并患者: ${row.patientName}`)
}

const handleIgnore = (row: any) => {
  ElMessage.info(`忽略患者: ${row.patientName}`)
}
</script>

<style lang="scss" scoped>
.auto-dedup-container {
  h2 {
    margin: 0;
    color: #303133;
  }
}
</style>